<?php
/******************************************
WWW.ZEAI.CN 作者: 郭余林　QQ:797311 (supdes)
未经本人同意，请不要删除版权，否则将追究法律责任
*****************************************/
if (ini_get('session.auto_start') == 0)session_start();
require_once '../sub/init.php';
header("Cache-control: private");
!function_exists('zeai_alone') && exit('forbidden');
if (!is_mobile())exit('请用手机打开');
$urlpar = 'subscribe='.intval($subscribe).'&tguid='.intval($tguid).'&admid='.intval($admid).'&tmpid='.intval($tmpid).'&ifback=1';
//if(!empty($t) && !ifint($cook_uid)){header("Location: ".a('{"kind":"my"}'));}
//if(ifint($cook_uid)){header("Location: ".a('{"kind":"my"}'));}
if (empty($cook_tmp_openid) && empty($t) && is_weixin()){$cook_tmp_openid=wx_get_openid(0);}
require_once ZEAI.'sub/conn.php';
require_once ZEAI.'cache/config_reg.php';
$reg_dataARR = explode(',',$_REG['reg_data']);
$SHALOU_ARR  = shalou_data($cook_uid);
$mate_diy    = explode(',',$_ZEAI['mate_diy']);
require_once ZEAI.'sub/TGfun.php';
require_once ZEAI.'sub/www_zeai_cn_sms.php';
if(ifint($cook_uid))require_once ZEAI.'sub/ZeaiUP.php';
require_once ZEAI.'cache/udata.php';
require_once ZEAI.'cache/config_vip.php';
require_once ZEAI.'m/reg_diy_success_flag.php';
$loginip=getip();
switch ($submitok) {
	case 'submitCut_success':
		//裁切新头像处理
		if(!empty($_cut)){
			$shalou_photo_s = $SHALOU_ARR['photo_s'];
			$_s = cut_save('u',$_cut,'all');
			//$db->query("UPDATE ".__TBL_USER__." SET photo_s='".$_s."',photo_f=1 WHERE id=".$uid);
			//$db->query("UPDATE ".__TBL_SHALOU__." SET photo_f=1 WHERE uid=".$uid);
			//set_data_ed_bfb($uid);
			//$SHALOU_ARR=shalou_data($cook_uid);
			$SHALOU_ARR['photo_s']=$_s;
			$jsonstr = encode_json($SHALOU_ARR);
			$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr',addtime=".ADDTIME." WHERE uid=".$cook_uid);
			//删老
			if(!empty($shalou_photo_s)){
				UP_modFn('u','del',$shalou_photo_s.'|'.smb($shalou_photo_s,'m').'|'.smb($shalou_photo_s,'b').'|'.smb($shalou_photo_s,'blur'));
			}
			json_exit(array('flag'=>'stop','msg'=>'裁切成功','_s'=>$_s));//,'_s'=>$_s,'idname'=>'photo_s'
		}else{
			json_exit(array('flag'=>0,'msg'=>'上传裁切更新失败'));
		}
	break;
	//yzmnew
	case 'ajax_click_yzm':
		$yzmarr = array('绿'=>'#0f0','蓝'=>'#00f','红'=>'#f00','黑'=>'#000','黄'=>'#fc0','粉'=>'#F8C2DE','灰'=>'#ccc','青'=>'#1EFFFB','紫'=>'#81007F','棕'=>'#993400');
		$_SESSION['colorKey'] = array_rand($yzmarr,1);
		$_SESSION['colorV']   = $yzmarr[$_SESSION['colorKey']];
		$yzmarr_new=shuffle_arr($yzmarr);
		foreach ($yzmarr_new as $k=>$V) {$echo.= '<li class=breath>'.$k.'</li>';}
		json_exit(array('flag'=>1,'bg'=>$_SESSION['colorV'],'li'=>$echo));
	break;
	case 'ajax_click_yzm_chk':
		if($v==$_SESSION['colorKey'] && $bg==$_SESSION['colorV']){
			json_exit(array('flag'=>1,'msg'=>'好样的，选择正确，正在发送手机验证码'));
		}else{
			json_exit(array('flag'=>0,'msg'=>'选择错误，请重新选择'));
		}
	break;
	case 'ajax_reg_verify':
		if ($_REG['reg_kind']==2)exit(JSON_ERROR);
		if(  $v!=$_SESSION['colorKey'] || $bg!=$_SESSION['colorV'] || empty($_SESSION['colorKey']) ||  empty($_SESSION['colorV'])  ){json_exit(array('flag'=>0,'msg'=>'验证码选择错误，请重新选择获取！'));}
		unset($_SESSION["colorKey"]);
		unset($_SESSION["colorV"]);
		if(!ifmob($mob)){
			json_exit(array('flag'=>0,'msg'=>'请输入正确的手机号码'));
		}else{
			if ($db->ROW(__TBL_USER__,"id","mob='$mob' AND FIND_IN_SET('mob',RZ)"))json_exit(array('flag'=>0,'msg'=>'此手机号码已被注册，请更换'));
		}
		if (($Temp_regyzmrenum > $_SMS['sms_yzmnum']) && $_SMS['sms_yzmnum']>0  )json_exit(array('flag'=>0,'msg'=>'你重复发送次数过多，已暂停发送'));
		$_SESSION['Zeai_cn__verify'] = cdstr(4);
		//sms
		$rtn = Zeai_sendsms_authcode($mob,$_SESSION['Zeai_cn__verify']);
		if ($rtn == 0){
			setcookie("Temp_regyzmrenum",$Temp_regyzmrenum+1,time()+86400,"/",$_ZEAI['CookDomain']);  
			$chkflag = 1;
			$content = '验证码发送成功，请注意查收';
		}else{
			$chkflag = 0;
			$content = "发送失败,错误码：$rtn"."-".sms_error($rtn);
		}
		//sms end
		$_SESSION['Zeai_cn__mob'] = $mob;
		json_exit(array('flag'=>$chkflag,'msg'=>$content));
	break;
	//yzmnewend
	case 'ajax_uname_addupdate':
		if ($_REG['reg_flag']==3)json_exit(array('flag'=>0,'msg'=>'本站已关闭【新用户注册】'));
		$pwd = md5(trim($pwd));
		/**************** 注册数据 ******************/
		if ($_REG['reg_kind']==1 || $_REG['reg_kind']==3){
			if (empty($_SESSION['Zeai_cn__verify'])){
				json_exit(array('flag'=>0,'msg'=>'短信验证码错误，请重新获取'));
			}else{
				if ($_SESSION['Zeai_cn__verify'] != $verify)json_exit(array('flag'=>0,'msg'=>'短信验证码不正确'));
				if ($_SESSION['Zeai_cn__mob'] != $mob && ifmob($mob)){
					unset($_SESSION["Zeai_cn__mob"]);
					json_exit(array('flag'=>0,'msg'=>'手机号码异常，请重新获取'));
				}
			}
			if (!ifmob($mob))json_exit(array('flag'=>0,'msg'=>'请输入正确的手机号码'));
			$row = $db->ROW(__TBL_USER__,'id,nickname,pwd,sex,photo_s',"uname='".$mob."' OR (mob='$mob' AND FIND_IN_SET('mob',RZ)) ","name");
			if($row){
				if($row['pwd']==$pwd){
					setcookie("cook_uid",$row['id'],time()+31536000,"/",$_ZEAI['CookDomain']);
					setcookie("cook_pwd",$row['pwd'],time()+31536000,"/",$_ZEAI['CookDomain']);
					setcookie("cook_sex",$row['sex'],time()+31536000,"/",$_ZEAI['CookDomain']);
					setcookie("cook_nickname",trimhtml(dataIO($row['nickname']),'out'),time()+31536000,"/",$_ZEAI['CookDomain']);
					$db->query("UPDATE ".__TBL_USER__." SET endtime=".ADDTIME.",endip='$loginip',logincount=logincount+1 WHERE id=".$row['id']);
					unset($_SESSION["Zeai_cn__verify"]);
					unset($_SESSION["Zeai_cn__mob"]);
					json_exit(array('flag'=>'logined','msg'=>'登录成功'));
				}else{
					json_exit(array('flag'=>0,'msg'=>'此手机已被注册,请重新输入'));	
				}
			}
		}
		if($_REG['reg_kind']==2 || $_REG['reg_kind']==3){
			$uname = trimhtml($uname);
			if (str_len($uname) > 20 || str_len($uname) < 3)json_exit(array('flag'=>0,'msg'=>'请输入正确的用户名（3~20位字母或加数字组合）'));
			if (ifmob($uname) || ifint($uname))json_exit(array('flag'=>0,'msg'=>'登录用户名不能是手机号码和纯数字'));
			if (str_len($uname) > 20 || str_len($uname)<3 || !preg_match('/^[A-Za-z0-9_\x{4e00}-\x{9fa5}]+$/u',$uname) )json_exit(array('flag'=>0,'msg'=>'请输入正确的用户名（3~20位字母或加数字组合）'));
			$row = $db->ROW(__TBL_USER__,'id',"uname='".$uname."' OR (mob='$uname' AND FIND_IN_SET('mob',RZ)) ");
			if($row)json_exit(array('flag'=>0,'msg'=>'此用户名已被注册,请重新输入'));
		}
		switch ($_REG['reg_kind']){
			case 1:$uname = 'm'.cdstr(5);break;
			case 2:$mob = 0;break;
		}
		//
		$regkind = 6;
		$tguid   = intval($tguid);
		$subscribe = intval($subscribe);
		$flag    = 2;
		$ip=getip();
		$reg_if2   = 9999;
		$sjtime    = 0;
		$sjtime2   = 0;
		$reg_grade = (ifint($_REG['reg_grade']) && $_REG['reg_grade']<=20)?intval($_REG['reg_grade']):1;
		$row = $db->ROW(__TBL_ROLE__,"if2","kind=1 AND grade=".$reg_grade,"num");
		if ($row)$reg_if2= $row[0];
		if($reg_grade>1){$sjtime=ADDTIME;$sjtime2=ADDTIME+86400*$reg_if2;}
		/**************** 入库 ******************/
		$ifINSERT=true;
		//防止关注后有openid跳过手机注册
		if (($_REG['reg_kind'] == 1 || $_REG['reg_kind'] == 3) && str_len($cook_tmp_openid)>20 ){
			$row = $db->ROW(__TBL_USER__,"id","openid='$cook_tmp_openid'","name");
			if ($row){
				$uid = $row['id'];
				$db->query("UPDATE ".__TBL_USER__." SET uname='$uname',pwd='$pwd' WHERE id=".$uid);
				$ifINSERT=false;
			}else{
				$ifINSERT=true;
			}
		}
		if($ifINSERT){
			$db->query("INSERT INTO ".__TBL_USER__." (subscribe,flag,uname,pwd,grade,if2,sjtime,sjtime2,regtime,endtime,regip,endip,refresh_time,regkind,tguid,openid) VALUES ($subscribe,$flag,'".$uname."','".$pwd."',$reg_grade,$reg_if2,$sjtime,$sjtime2,".ADDTIME.",".ADDTIME.",'$ip','$ip',".ADDTIME.",$regkind,$tguid,'$cook_tmp_openid')");
			$uid = intval($db->insert_id());
		}
		shalou_init($uid);
		//
		$row_shalou=shalou_data($uid);
		$row_shalou['photo_s'] = '';
		$jsonstr = encode_json($row_shalou);
		$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr' WHERE uid=".$uid);
		//
		set_data_ed_bfb($uid);
		if(ifmob($mob) && ($_REG['reg_kind']==1 || $_REG['reg_kind']==3)){
			$db->query("UPDATE ".__TBL_USER__." SET mob='$mob',RZ='mob' WHERE id=".$uid);
		}
		/**************** 第三方 ******************/
		if(ifint($tmpid)){
			$row = $db->ROW(__TBL_TMP__,"c","id=".$tmpid,"num");
			if ($row){
				$c        = json_decode($row[0],true);
				$regkind  = $c['regkind'];
				/**** QQ ******/
				if($regkind=='qq'){
					$regkind  = 4;
					$loginkey = $c['openid'];
					$nickname = dataIO($c['nickname'],'in',20);
					//$dbname = (!empty($c['photo_s']))?wx_get_uinfo_logo($c['photo_s'],$uid):'';
					//$photo_s=setpath_s($dbname);
					$db->query("UPDATE ".__TBL_USER__." SET regkind=$regkind,loginkey='$loginkey',nickname='$nickname' WHERE id=".$uid);//,photo_s='$photo_s'
				/**** weixin ****/
				}elseif($regkind=='weixin'){
					$regkind=3;
					$openid   = $c['openid'];
					$nickname = dataIO($c['nickname'],'in',20);
					$unionid  = $c['unionid'];
					//$dbname = (!empty($c['headimgurl']))?wx_get_uinfo_logo($c['headimgurl'],$uid):'';
					//$photo_s=setpath_s($dbname);
					$db->query("UPDATE ".__TBL_USER__." SET regkind=$regkind,openid='$openid',unionid='$unionid',nickname='$nickname' WHERE id=".$uid);//,photo_s='$photo_s'
				}elseif($regkind=='app'){
					$regkind=8;
					$unionid  = $c['unionid'];
					$db->query("UPDATE ".__TBL_USER__." SET regkind=$regkind,unionid='$unionid' WHERE id=".$uid);//,photo_s='$photo_s'
				}
			}
			$db->query("DELETE FROM ".__TBL_TMP__." WHERE id=".$tmpid);
		}
		setcookie("cook_uid",$uid,time()+31536000,"/",$_ZEAI['CookDomain']);
		setcookie("cook_pwd",$pwd,time()+31536000,"/",$_ZEAI['CookDomain']);
		json_exit(array('flag'=>1,'msg'=>'注册成功'));
	break;
	case 'next_update':
		if(!in_array($t,$reg_dataARR))callmsg('唉，参数跑路了','-1');
		if($t!='mate'){
			$v=$$t;
			if(empty($v))header("Location: ".SELF);
			$t_k =data_data_subkind($t);
			if($t_k==1){$v=($t=='aboutus')?dataIO(trimhtml($v,'keep_rn'),'in'):trimhtml($v);}
			$tipsjson='{"title":"请输入或选择正确的【'.data_data_title($t).'】","btnt":"我知道了","url":"-1"}';
			if(empty($v))zeaialert($tipsjson);
		}
		switch ($t) {
			case 'identitynum':if(!ifsfz($v)){zeaialert($tipsjson);exit;}break;
			case 'aboutus':$v=dataIO($v,'in',2000);break;
			case 'nickname':
				$v=dataIO($v,'in',50);
				if(empty($v) || str_len($v)<2)zeaialert($tipsjson);
			break;
			case 'truename':$v=dataIO($v,'in',12);break;
			case 'sex':$v=intval($v);$v=($v>3)?3:$v;
				$db->query("UPDATE ".__TBL_USER__." SET sex='$v' WHERE id=".$cook_uid);
			break;
			case 'photo_s':if(str_len($v)<21)callmsg('请上传头像照片','-1');break;
		}
		if($t=='mate' && count($mate_diy) >= 1 && is_array($mate_diy)){
			foreach ($mate_diy as $F) {
				switch ($F) {
					case 'areaid':
						$SHALOU_ARR['mate_areaid']=$form_mate_areaid;
						$SHALOU_ARR['mate_areatitle']=$form_mate_areatitle;
					break;
					case 'areaid2':
						$SHALOU_ARR['mate_areaid2']=$form_mate_areaid2;
						$SHALOU_ARR['mate_areatitle2']=$form_mate_areatitle2;
					break;
					default:
						$ext = mate_diy_par($F,'ext');
						if($ext=='radiorange'){
							$mate_F = 'form_mate_'.$F;
							$mate_form=explode(',',$$mate_F);
							$mate_form1=$mate_form[0];$mate_form2=$mate_form[1];
							$SHALOU_ARR['mate_'.$F.'1']=$mate_form1;
							$SHALOU_ARR['mate_'.$F.'2']=$mate_form2;
//						}elseif($ext=='checkbox'){
//							$mate_F = 'form_mate_'.$F;
//							$list=$$mate_F;
//							$list = (is_array($list))?implode(',',$list):'';
//							$SHALOU_ARR['mate_'.$F]=$list;
						}else{
							$mate_F = 'form_mate_'.$F;
							$SHALOU_ARR['mate_'.$F]=$$mate_F;
						}
					break;
				}
			}
		}elseif($t=='areaid'){
			$SHALOU_ARR[$t]=$v;
			$SHALOU_ARR['areatitle']=dataIO($areatitle,'in',100);
		}elseif($t=='area2id'){
			$SHALOU_ARR[$t]=$v;
			$SHALOU_ARR['area2title']=dataIO($area2title,'in',100);
		}else{
			$SHALOU_ARR[$t]=$v;
		}
		Dmod(encode_json($SHALOU_ARR));
		header("Location: ".SELF);
	break;
}
/*fld*/
$fld='id,sex,pwd,flag';
if(!empty($t)){
	if(!in_array($t,$reg_dataARR))header("Location: ".SELF);
	//按步骤单个字段
	if(in_array('mate',$reg_dataARR) && $t=='mate'){
		$fld=str_replace("mate",get_mate_fld(),$fld);	
	}else{$fld.=','.$t;}
	if(in_array('parent',$reg_dataARR))$fld.=',parent';
	$fld = implode(',',array_unique(explode(',',$fld)));
}else{
	//智能适配字段
	$fld.=','.$_REG['reg_data'];
	$fldARR = explode(',',$fld);
	$fldARR = array_unique($fldARR);
	$fld = implode(',',$fldARR);
	if(in_array('mate',$reg_dataARR))$fld=str_replace("mate",get_mate_fld(),$fld);
}
/*chk flag*/
if(str_len($cook_tmp_openid) >15 && is_weixin() && empty($t)){
	//防止关注后有openid跳过手机注册
	if ($_REG['reg_kind'] == 1 || $_REG['reg_kind'] == 3){
		$SQ=" AND FIND_IN_SET('mob',RZ)";
	}
	$row = $db->ROW(__TBL_USER__,$fld,"openid='$cook_tmp_openid'".$SQ,"name");
	if ($row){
		if(empty($t))$flagFn=flagFn($row);
	}else{ZEclearcookAI_CN();/*header("Location: ".SELF);exit;*/}
}elseif(ifint($cook_uid) && !empty($cook_pwd)){
	$row = $db->ROW(__TBL_USER__,$fld,"id=".$cook_uid." AND pwd='".$cook_pwd."'",'name');
	if ($row){
		if(empty($t))$flagFn=flagFn($row);
	}else{ZEclearcookAI_CN();/*header("Location: ".SELF);exit;*/}
}else{
	if(!in_array($t,explode(',',$_REG['reg_data'])) && !empty($t)){header("Location: ".SELF);exit;}
}
if(!empty($SHALOU_ARR) && is_array($SHALOU_ARR) && count($SHALOU_ARR)>0 && !empty($t)){
	$t_v=$SHALOU_ARR[$t];
	if(in_array('parent',$reg_dataARR)){
		$parent=$SHALOU_ARR['parent'];
		$chenghu=(ifint($parent))?arrT($_UDATA['parent'],$parent,'v2'):'';$chenghu=str_replace("您","",$chenghu);
	}
}
/********************************************************正文开始********************************************************/
$headertitle = '新用户注册-';$nav = 'my';?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $headertitle;?><?php echo $_ZEAI['siteName'];?></title>
<?php echo HEADMETA; ?>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo HOST;?>/cache/zeaicolor.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo HOST;?>/cache/udata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php if ($t == 'areaid'  || $t == 'area2id' || $t == 'mate'){?>
<script src="<?php echo HOST;?>/cache/areadata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php }?>
<script>
var upurl='<?php echo SELF;?>',Sbindbox='',jumpurl = '<?php echo urlencode($jumpurl);?>',t='<?php echo $t;?>',upMaxMB = <?php echo intval($_UP['upMaxMB']); ?>,browser='<?php echo (is_weixin())?'wx':'h5';?>',reg_kind=<?php echo $_REG['reg_kind']?>;
</script>
<script src="<?php echo RES;?>m/js/reg_diy.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo RES;?>m/css/reg_diy.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<meta name="generator" content="Zeai.cn V9" />
<?php
if (is_weixin()){
    require_once ZEAI."api/weixin/jssdk.php";?>
    <script src="<?php echo RES;?>jweixin-1.2.0.js"></script>
    <script>
    wx.config({debug: false,
        appId: '<?php echo $signPackage["appId"];?>',
        timestamp: <?php echo $signPackage["timestamp"];?>,
        nonceStr: '<?php echo $signPackage["nonceStr"];?>',
        signature: '<?php echo $signPackage["signature"];?>',
        jsApiList: ['chooseImage','uploadImage','previewImage','hideMenuItems','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo']
    });
    </script>
<?php }?>
<style>
.submain ul.def li.ed,.areabox .ul li a.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>;background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.1)}
.nextbtn button{box-shadow:0 .3rem .8rem rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.4)}
.submain .ios-select-widget-box ul li.at{color:<?php echo $_ZEAI['mob_mbcolor'];?>}
<?php if ($t == 'areaid' || $t == 'area2id'){?>
.areabox .ul dt.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>;border-top-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
<?php }elseif($t=='mate'){?>
.areabox .ul li a{position:relative;color:#666;background-color:#f7f7f7;height:3.4rem;line-height:3.4rem;overflow:hidden;border:0;padding:0 .6rem}
.areabox .ul li a:hover:before,.areabox .ul li a.ed:before{position:absolute;font-family:"www_zeai_cn_iconfont" !important;content:"\e64a";width:1.8rem;height:1.8rem;line-height:1.8rem;font-size:1.8rem;right:0;bottom:0}
.areabox .ul dl dd{border-color:#eee}
<?php }?>
.TRnav_btn,.TRnav .TRnav_btn2 i{color:<?php echo $_ZEAI['mob_mbcolor'];?>}
</style>
</head><body><?php
if(!empty($t) || $flagFn=='end'){$mini_class='top_mini4';$mini_L='<em onClick="zeai.goback();"><i class="ico" >&#xe602;</i><span></span></em>';require_once ZEAI.'m/top_mini.php';}
if ($_REG['reg_flag']==3){?>
	<div class="nodataSorry">
    	<i class="ico">&#xe659;</i><font>新用户注册已关闭<br>开通日期另行通知</font>
        <a href="<?php echo HOST;?>" class="btn size4 zeaibg">返回首页</a>
    </div><?php exit;
}
if($flagFn=='end' || $flagFn=='regpay' || !empty($t)){?>
    <div class="reg_diy_step">
    	<li class="ed"><i class="zeaibg">1</i><span class="zeaicolor">帐号信息</span><div class="zeaibg"></div></li>
    	<li class="ed"><i class="zeaibg">2</i><span class="zeaicolor">登记资料<?php $data_bfb=get_reg_data_bfb($t);echo ($data_bfb>0)?$data_bfb.'%':'';?></span><div class="zeaibg"></div></li>
        <?php if ($flagFn == 'end'){?>
            <li class="ed"><i class="zeaibg">3</i><span class="zeaicolor">注册完成</span><div class="zeaibg"></div></li>
        <?php }else{ ?>
            <li><i class="off">3</i><span>注册完成</span><div class="line"></div></li>
        <?php }?>
    </div>
	<?php
	require_once ZEAI.'cache/config_wxgzh.php';
	$kf_tel=dataIO($_ZEAI['kf_tel'],'out');$kf_mob=dataIO($_ZEAI['kf_mob'],'out');$kf_wxpic=dataIO($_ZEAI['kf_wxpic'],'out');
	if($flagFn=='end'){?>
        <div class="reg_diy_success">
            <i class="ico flag">&#xe67f;</i>
            <h4 class="title">您的资料提交成功</h4>
            <h4 class="textsuccess">审核通过会立即显示在平台中</h4>
            <em>
			<?php if (is_weixin()){?>
            	<img src="<?php echo UP.$_GZH['wx_gzh_ewm'];?>"><font>长按二维码关注公众号 接收信息通知</font>
            <?php }else{?>
            	<?php if (!empty($kf_wxpic)){?><img src="<?php echo UP.$kf_wxpic;?>"><font>长按二维码加客服微信</font><br><?php }?>
            <?php }?>
			<?php if (!empty($kf_tel)){?>
                <a href="tel:<?php echo $kf_tel;?>"><i class="ico">&#xe7c1;</i><?php echo $kf_tel;?></a><br>
            <?php }else{?>
                <?php if (!empty($kf_mob)){?><a href="tel:<?php echo $kf_mob;?>"><i class="ico">&#xe7c1;</i><?php echo $kf_mob;?></a><?php }?>
            <?php }?>
            </em>
            <br><a href="<?php echo HOST;?>" class="S16">进入缘分大厅<i class="ico">&#xe601;</i></font></a>
        </div>
		<div class="nextbtn"><a href="my.php" class="btn size5 B ed zeaibg">我的个人中心</a></div>
    	<?php
		exit;
	}elseif($flagFn=='regpay'){
		$row = $db->ROW(__TBL_USER__,"sex","id=".$cook_uid,"name");
		$cook_sex=$row['sex'];
		$regmoney = $_REG['regmoney'.$cook_sex];
		if($regmoney>0){?>
			<div class="reg_diy_success">
				<i class="ico flag">&#xe67f;</i>
				<h4 class="title">您的资料提交成功</h4>
				<h4 class="textsuccess">审核通过会立即显示在平台中</h4>
				<em>
				<?php if (!is_weixin()){?>
					<img src="<?php echo UP.$_GZH['wx_gzh_ewm'];?>"><font>长按二维码关注公众号 接收信息通知</font>
				<?php }else{?>
					<?php if (!empty($kf_wxpic)){?><img src="<?php echo UP.$kf_wxpic;?>"><font>长按二维码加客服微信</font><br><?php }?>
				<?php }?>
				</em>
				<br><br><div class="S16">您需要支付<font class="Cf00"><?php echo $regmoney;?>元</font>审核费</div>
			</div>
			<div class="nextbtn"><button type="button" class="btn size5 B ed zeaibg" id="reg_nextbtn">立即支付（￥<?php echo $regmoney;?>）</button></div>
			<script src="<?php echo HOST;?>/api/zeai_PAY.js?<?php echo $_ZEAI['cache_str'];?>"></script>
			<script>reg_nextbtn.onclick=function(){ZeaiM.div_up({obj:czbox,h:<?php echo (is_weixin())?23.5:30.5;?>});}</script>
			<?php
			$jump_url = HOST.'/m/reg_diy.php';
			$money = $regmoney;
			$kind  = 20;
			$cook_money=0;
			echo '<input type="hidden" id="money" value="'.$money.'">';
			require_once 'my_pay.php';exit;
		}
	}
}
//初始化
if(!empty($t)){
	$t_t = data_data_title($t);$t_k =data_data_subkind($t);
	switch ($t_k) {
		case 1:$t_k_berore='请输入';break;
		case 2:$t_k_berore='请选择';break;
		case 3:$t_k_berore='请选择';break;
		case 4:$t_k_berore='请选择';break;
		case 5:$t_k_berore='请选择';break;
	}
	if($t=='parent'){
		$h1='替谁征婚';
	}elseif($t=='marrytime'){
		$h1=$chenghu.$t_t;
	}elseif($t=='photo_s'){
		$h1='请上传'.$chenghu.'本人'.$t_t;
	}elseif($t=='nickname'){
		$h1=$t_k_berore.$chenghu.'网名/'.$t_t;
	}else{
		$h1=$t_k_berore.$chenghu.$t_t;
	}
	$h5='精准推荐，提高曝光成功率，请真实完善以下个人信息，否则将不能通过审核';
	if($t=='photo_s'){
		$h5.='<div class="zeaicolor">个人中心可以修改保密或公开</div>';	
	}elseif($t=='truename' || $t=='identitynum'){
		$h5.='<div class="zeaicolor"><br>请放心此资料不会公开，仅管理员看到</div>';	
	}
	//默认值
	switch ($t) {
		case 'birthday':$t_v=(empty($t_v) || $t_v=='0000-00-00')?(date('Y')-23).'-05-20':$t_v;break;
		case 'edu':$t_v=(empty($t_v))?3:$t_v;break;
		case 'pay':$t_v=(empty($t_v))?5:$t_v;break;
		case 'heigh':$t_v=(empty($t_v))?168:$t_v;break;
		case 'weigh':$t_v=(empty($t_v))?50:$t_v;break;
		case 'areaid':$areatitle=$SHALOU_ARR['areatitle'];break;
		case 'area2id':$area2title=$SHALOU_ARR['area2title'];break;
		default:if($t_k==2){$t_v=(empty($t_v))?1:$t_v;}break;
	}
	//页面输出
	?>
	<div class="reg_diy_tbody">
        <h1><?php echo $h1;?></h1>
        <h5><?php echo $h5;?></h5>
    </div>
    <form method="post" action="reg_diy.php" id="Z-E-A-I_form">
    <div class="submain <?php echo $t;?>" id="submain">
		<?php
		$onblur='';
        switch ($t_k) {
            case 1://文本
				if($t=='nickname' || $t=='weixin'){
					$maxlength=50;
				}elseif($t=='truename'){
					$maxlength=12;
				}elseif($t=='identitynum'){
					$maxlength=18;
				}elseif($t=='aboutus'){
					$maxlength=2000;
				}else{
					$maxlength=100;
				}
				$onblur=' onblur="rettop();"';
				?>
                <em>
                <?php if ($t=='aboutus'){?>
                    <textarea class="textarea" name="aboutus" placeholder="请输入简短个人介绍，三观等 （1000字以内，全部人工审核，切勿填写联系方式 否则资料无法通过审核。）" onBlur="rettop();"><?php echo trimhtml(dataIO($t_v,'wx'),'keep_rn');?></textarea>
                <?php }else{ ?>
                	<input name="<?php echo $t;?>" type="text" class="input" placeholder="请输入【<?php echo $t_t;?>】" value="<?php echo $t_v;?>" autocomplete="off" maxlength="<?php echo $maxlength;?>"<?php echo $onblur;?>>
				<?php }?>
                </em>
			<?php break;case 2://单选
				$tARR = json_decode($_UDATA[$t]);
				$ulcls=ulclsFn($tARR);
				echo '<ul class="'.$ulcls.'">';
				foreach ($tARR as $V) {
					if($t=='sex'){
						$cls=($V->i==$t_v)?'ed ':'';
						switch ($V->i) {
							case 1:$ico='&#xe637;';$ename = 'Man';break;
							case 2:$ico='&#xe639;';$ename = 'Woman';break;
						}
						echo '<li v="'.$V->i.'" class="'.$cls.'sexli'.$V->i.'"><i class="ico">'.$ico.'</i><span>'.$V->v.'<br><font>'.$ename.'</font></span></li>';
					}else{
						$cls=($V->i==$t_v)?' class="ed"':'';
						echo '<li'.$cls.' v="'.$V->i.'">'.$V->v.'</li>';
					}
				}
				echo '<div class="clear"></div></ul>';?>
            	<input type="hidden" id="<?php echo $t;?>" name="<?php echo $t;?>" value="<?php echo $t_v;?>">
				<script>reg_diy_radio(t);</script>
           <?php break;case 3://复选
            	$tARR = json_decode($_UDATA[$t]);
				$ulcls=ulclsFn($tARR);
				$t_vARR=explode(',',$t_v);
				echo '<ul class="'.$ulcls.'">';
				foreach ($tARR as $V) {
					$cls=(in_array($V->i,$t_vARR))?' class="ed"':'';
					echo '<li'.$cls.' v="'.$V->i.'">'.$V->v.'</li>';
				}
				echo '<div class="clear"></div></ul>';?>
				<input type="hidden" id="<?php echo $t;?>" name="<?php echo $t;?>" value="<?php echo $t_v;?>">
				<script>reg_diy_checkbox(t);</script>
			<?php break;case 4://区间?>
                <div id="<?php echo $t;?>_box"></div>
                <input type="hidden" id="<?php echo $t;?>" name="<?php echo $t;?>" value="<?php echo $t_v;?>">
                <script src="<?php echo RES;?>zeai_ios_select/separate/select.js?<?php echo $_ZEAI['cache_str'];?>"></script>
                <script>
                var Sbindbox = '<?php echo $t;?>_box';
                ios_select1_normal('ZEAI_SUPDES',<?php echo $t;?>_ARR,<?php echo $t_v;?>,function(obj1){o('<?php echo $t;?>').value = obj1.i;})
                </script>
			<?php break;case 5://特殊
				switch ($t) {
					case 'birthday':?>
                        <div id="birthday_box"></div>
                        <input type="hidden" id="<?php echo $t;?>" name="<?php echo $t;?>" value="<?php echo $t_v;?>">
						<script src="<?php echo RES;?>zeai_ios_select/separate/select.js?<?php echo $_ZEAI['cache_str'];?>"></script>
                        <script src="<?php echo RES;?>m/js/birthday.js?<?php echo $_ZEAI['cache_str'];?>"></script>
						<script>
                        var Sbindbox = 'birthday_box';
                        ios_select_next('sr',yearData, monthData, dateData,'<?php echo $t_v;?>',function(obj1,obj2,obj3){
							o('birthday').value = obj1.i + '-' + obj2.i + '-' + obj3.i;
                        },'-');
                        </script>
					<?php break;case 'areaid':?>
                        <div id="areabox" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
                        <input type="hidden" id="<?php echo $t;?>" name="<?php echo $t;?>" value="<?php echo $t_v;?>">
                        <input type="hidden" id="areatitle" name="areatitle" value="<?php echo $t_v;?>">
                        <script src="<?php echo RES;?>m/js/zeai_div_area.js?<?php echo $_ZEAI['cache_str'];?>"></script>
                        <script>
                            ZEAI_area({areaid:'<?php echo $t_v;?>',areatitle:'<?php echo $areatitle;?>',ul:areabox.children[0],str:'job',end:function(z,e){
                                o('<?php echo $t;?>').value = z;
                                o('areatitle').value = e;
                            }});
                        </script>
					<?php break;case 'area2id':?>
                        <div id="areabox" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
                        <input type="hidden" id="<?php echo $t;?>" name="<?php echo $t;?>" value="<?php echo $t_v;?>">
                        <input type="hidden" id="area2title" name="area2title" value="<?php echo $t_v;?>">
                        <script src="<?php echo RES;?>m/js/zeai_div_area.js?<?php echo $_ZEAI['cache_str'];?>"></script>
                        <script>
                            ZEAI_area({areaid:'<?php echo $t_v;?>',areatitle:'<?php echo $area2title;?>',ul:areabox.children[0],str:'hj',datastr:'hj',end:function(z,e){
                                o('<?php echo $t;?>').value = z;
                                o('area2title').value = e;
                            }});
                        </script>
					<?php break;case 'photo_s':
						$photo_s_str = (!empty($photo_s))?'<img src="'.UP.smb($photo_s,'m').'">':'<i class="ico">&#xe609;</i><h5>点击上传</h5>';?>
                        <script>var upMaxMB = <?php echo $_UP['upMaxMB']; ?>,maxnum=1,browser='<?php echo browser();?>',up2='<?php echo UP;?>';</script>
                        <script src="<?php echo RES;?>m/js/ZeaiUP.js?<?php echo $_ZEAI['cache_str'];?>"></script>
                        <style>
							.photo_s .icoadd{border-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.2);background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.05)}
							.photo_s .icoadd h5,.photo_s .icoadd i.ico{color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.6)}
                        </style>   
                        <div class="icoadd" id="photo_sbtn"><?php echo $photo_s_str;?></div>
                        <h6>上传<?php echo $chenghu;?>照片，成功率提升300%</h6>
                        <div id="nophoto_sBox">
                            <div class="linebox"><div class="line W50"></div><div class="title S14 C999 BAI">头像审核通过标准</div></div>
                            <div class="reg_p">
                                <li><img src="<?php echo RES;?>m/img/reg_p/1.jpg"><i class="ico dui">&#xe60f;</i><font>真实居中</font></li>
                                <li><img src="<?php echo RES;?>m/img/reg_p/2.jpg"><i class="ico dui">&#xe60f;</i><font>上半身照</font></li>
                                <li><img src="<?php echo RES;?>m/img/reg_p/3.jpg"><i class="ico cuo">&#xe62c;</i>模糊不清</li>
                                <li><img src="<?php echo RES;?>m/img/reg_p/4.jpg"><i class="ico cuo">&#xe62c;</i>过于暴露</li>
                                <li><img src="<?php echo RES;?>m/img/reg_p/5.jpg"><i class="ico cuo">&#xe62c;</i>P图过度</li>
                                <li><img src="<?php echo RES;?>m/img/reg_p/6.jpg"><i class="ico cuo">&#xe62c;</i>背影照</li>
                                <li><img src="<?php echo RES;?>m/img/reg_p/7.jpg"><i class="ico cuo">&#xe62c;</i>头像太小</li>
                                <li><img src="<?php echo RES;?>m/img/reg_p/8.jpg"><i class="ico cuo">&#xe62c;</i>非人物照</li>
                                <div class="clear"></div>
                            </div>
                        </div>
						<input type="hidden" id="<?php echo $t;?>" name="<?php echo $t;?>" value="<?php echo $t_v;?>">
                        <script>
						ZeaiUP.one({url:'reg_diy'+zeai.extname,submitokBef:'ajax_tmpB_',btnobj:photo_sbtn,end:function(e){
							if(e.flag==1){
								ZeaiM.div_left({obj:cut_box,w:zeai.bodyW()});
								var dbname = e.dbname;
								cut_tmppic.src=up2+dbname;
								www_a9a_cn_cut = new ZEAICUT(<?php echo $cook_uid;?>);
								www_a9a_cn_cut.wake();
								www_a9a_cn_cut.init();
							}else{
								zeai.msg(e.msg);	
							}
						}});
						function submitCut_success_callback(rs) {
							o(photo_sbtn).html('<img src="'+up2+rs._s.replace('_s.','_m.')+'"><h5 class="ed">重新上传</h5>');
							o('<?php echo $t;?>').value = rs._s;
							$("#submit_cut2").find("img").hide();
							setTimeout(function(){$("#cut_tmppic").removeClass("dis_submit");cut_cancel.click();},2000);
						}
                        </script>
                        <?php require_once ZEAI.'res/m/cut.html';?>
                    <?php break;case 'mate':?>
						<style>
						.mate .ios-select-widget-box header.iosselect-header a.sure,.divBtmMod .divBtmSave,.checkskin:checked + label.checkskin-label i{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>;}
						.checkskin:checked + label.checkskin-label i{border-color:<?php echo $_ZEAI['mob_mbcolor'];?>;}
						.areabox .ul dt.ed{border-top-color:<?php echo $_ZEAI['mob_mbcolor'];?>;color:<?php echo $_ZEAI['mob_mbcolor'];?>}
                        </style>
                        <div id="mate" class="listbox">
							<?php
                            if (count($mate_diy) >= 1 && is_array($mate_diy)){
                                foreach ($mate_diy as $F) {
                                    $ext = mate_diy_par($F,'ext');
                                    switch ($ext) {
                                        case 'radio':
                                            $class = 'slect';
                                            $mate_data     = intval($SHALOU_ARR['mate_'.$F]);
                                            $mate_data_str = udata($F,$mate_data);
                                        break;
                                        case 'radiorange':
                                            $class  = 'rang';
                                            $mate_data1     = intval($SHALOU_ARR['mate_'.$F.'1']);
                                            $mate_data2     = intval($SHALOU_ARR['mate_'.$F.'2']);
                                            $mate_data      = $mate_data1.','.$mate_data2;
                                            $dwarr=json_decode($_UDATA[$F],true);
                                            $dw   = $dwarr['dw'];
                                            $mate_data_str  = mateset_out($mate_data1,$mate_data2,$dw);
                                            $mate_data_str = str_replace("不限","",$mate_data_str);
                                        break;
                                        case 'checkbox':
                                            $class  = 'chckbox';
                                            $mate_data     = $SHALOU_ARR['mate_'.$F];
                                            $mate_data_str = udata($F,$mate_data);
                                        break;
                                        case 'area':$class = 'aread';break;
                                    }
                                    switch ($F) {
                                        case 'areaid':
                                            $class='aread';$placeholder='请选择';$spanid=' id="areatitle"';
                                            $mate_data = $SHALOU_ARR['mate_'.$F];
                                            $mate_data_str = $SHALOU_ARR['mate_areatitle'];?>
                                            <input type="hidden" id="form_mate_areatitle" name="form_mate_areatitle" value="<?php echo $mate_data_str;?>">
                                            <?php
                                        break;
                                        case 'areaid2':
                                            $class='aread2';$placeholder='请选择';$spanid=' id="area2title"';
                                            $mate_data = $SHALOU_ARR['mate_'.$F];
                                            $mate_data_str = $SHALOU_ARR['mate_areatitle2'];?>
                                            <input type="hidden" id="form_mate_areatitle2" name="form_mate_areatitle2" value="<?php echo $mate_data_str;?>">
                                            <?php
                                        break;
                                        default:$spanid='';break;
                                    }
                                    //默认值
                                    if(empty($mate_data) || $mate_data=='0,0'){
                                        switch ($F) {
                                            case 'age':$mate_data='23,40';break;
                                            case 'edu':$mate_data=3;break;
                                            case 'pay':$mate_data=5;break;
                                            case 'heigh':$mate_data='160,175';break;
                                            case 'weigh':$mate_data='50,70';break;
                                        }
                                    }
                                    echo '<dl id="mate_'.$F.'" class="'.$class.'" data="'.$mate_data.'"><dt>'.mate_diy_par($F).'</dt><dd><span'.$spanid.'>'.$mate_data_str.'</span></dd></dl>';?>
                                    <input type="hidden" id="form_mate_<?php echo $F;?>" name="form_mate_<?php echo $F;?>" value="<?php echo $mate_data;?>">
                            <?php }}?>
						</div>
                        <?php if (in_array('areaid',$mate_diy)){?>
                            <div id="areabox" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
                        <?php }?>
                        <?php if (in_array('areaid2',$mate_diy)){?>
                            <div id="areabox2" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
                        <?php }?>
                        <script src="<?php echo RES;?>zeai_ios_select/separate/select.js?<?php echo $_ZEAI['cache_str'];?>"></script>
						<script>
                        Sbindbox = 'mate';zeai.listEach(zeai.tag(o('mate'),'dl'),function(obj){
							switch (obj.className){
								case 'aread':
									o('mate_areaid').onclick=function(){
										ZeaiM.div_up({obj:areabox,h:43});
										ZEAI_area({bx:true,areaid:o('form_mate_areaid').value,areatitle:o('form_mate_areatitle').value,ul:areabox.children[0],str:'job',end:function(z,e){
											o('areatitle').html(e);o('areatitle').class('ed');
											o('form_mate_areaid').value=z;
											o('form_mate_areatitle').value=e;
										}});
									}
								break;
								case 'aread2':
									o('mate_areaid2').onclick=function(){
										ZeaiM.div_up({obj:areabox2,h:43});
										ZEAI_area({bx:true,areaid:o('form_mate_areaid2').value,areatitle:o('form_mate_areatitle2').value,ul:areabox2.children[0],str:'hj',datastr:'hj',end:function(z,e){
											o('area2title').html(e);o('area2title').class('ed');
											o('form_mate_areaid2').value=z;
											o('form_mate_areatitle2').value=e;
										}});
									}
								break;
								default:
									switch (obj.className) {
										case 'slect':kind = 'select';break;
										case 'rang':kind = 'range';break;
										case 'chckbox':kind = 'checkbox';break;
									}
									ZeaiM.divMod({kind:kind,obj:obj,end:function(e,i){
										o('form_'+obj.id).value=e;
;
									}});
								break;
							}
						});
                        </script>
						<script src="<?php echo RES;?>m/js/zeai_div_area.js?<?php echo $_ZEAI['cache_str'];?>"></script>
                   <?php break;
				}
			break;
        }
        ?>
    </div>
    <input type="hidden" name="t" value="<?php echo $t;?>">
    <input type="hidden" name="submitok" value="next_update">
    <div class="nextbtn"><button type="submit" class="btn size5 B ed zeaibg">下一步</button></div>
    </form>
	<?php
    /********************************************************默认帐号初始********************************************************/
}else{?>
    <?php if ($ifback==1){?><a href="javascript:history.back(-1)" class="ico Ugoback" style="background:none;top:5px;left:5px">&#xeaca;</a><?php }?>
    <div class="submain reg_diy huadong" id="main">
        <?php $reg_banner=(!empty($_REG['reg_banner']))?UP.smb($_REG['reg_banner'],'b'):RES.'reg_banner.png?'.$_ZEAI['cache_str'];?>
		<div class="banner zeaibg"><img src="<?php echo $reg_banner;?>"></div>
        <div<?php echo (!$ifreg2)?' style="display:none"':'';?> class="ifreg2" id="ifreg2">
            <?php 
			switch ($cook_sex) {
				case 1:$ico='&#xe60c;';break;
				case 2:$ico='&#xe95d;';break;
				default:$ico='&#xe61f;';$ename = 'zeai.cn';break;
			}
			?>
           <div class="sex<?php echo $cook_sex;?>"><i class="ico sexico"><?php echo $ico;?></i><h4><?php echo $cook_uname;?><font class="S14 C999">（UID:<?php echo $cook_uid;?>）</font></h4></div>
           <br>您上次注册未完成<br>开启幸福之旅只差一步
		<input type="button" value="继续注册" class="btn size5 HONG B ed" onClick="regnext();">
        </div>
        <form id="WWW_ZEAI_CN_form"<?php echo ($ifreg2)?' style="display:none"':'';?>>
            <?php if ($_REG['reg_kind'] == 1 || $_REG['reg_kind'] == 3){?>
            
                <dl><dt><i class="ico">&#xe627;</i></dt><dd><input name="mob" type="text" class="input_login" id="mob" placeholder="请输入手机号码" autocomplete="off" maxlength="11" pattern="[0-9]*" onBlur="rettop();"></dd></dl>
                <dl><dt><i class="ico">&#xe6c3;</i></dt><dd class="yzmF">
                <input name="verify" id="verify" type="text" required class="input_login" maxlength="4" pattern="[0-9]*" placeholder="输入手机验证码" autocomplete="off" onBlur="rettop();" /><a class="yzmbtn" id="yzmbtn">获取验证码</a>
                    <div id="zeai_yzm"><em id="zeai_yzm_em"></em><span>这是什么颜色？请点击下面文字确定</span><div class="text" id="zeai_yzm_li"></div></div>
                </dd></dl>
                <script>
				yzmbtn.onclick = function(){
					if (zeai.ifmob(o('mob').value)){
						if (!yzmbtn.hasClass('disabled')){ajax_click_yzmFn();}
					}else{
						zeai.msg('请输入手机号码');return false;
					}
				}
                </script>
                <dl style="display:none"><dt><i class="ico">&#xe620;</i></dt><dd><input name="pwd" type="password" class="input_login" id="pwd" placeholder="请输入登录密码" autocomplete="off" maxlength="20" onBlur="rettop();" value="<?php echo 'www@zeai@cn'.cdnumletters(5);?>"></dd></dl>
            <?php }if($_REG['reg_kind'] == 2 || $_REG['reg_kind'] == 3){ ?>
                <dl><dt><i class="ico uname">&#xe645;</i></dt><dd><input name="uname" type="text" class="input_login" id="uname" placeholder="请输入登录用户名" autocomplete="off" maxlength="20" onBlur="rettop();"></dd></dl>
                <dl><dt><i class="ico">&#xe620;</i></dt><dd><input name="pwd" type="password" class="input_login" id="pwd" placeholder="请输入登录密码" autocomplete="off" maxlength="20" onBlur="rettop();" ></dd></dl>

            <?php }?>
            <div class="clause7">提交注册即表示您已阅读并同意<a href="javascript:agreeDeclara();" class="zeaicolor">《隐私政策》</a></b></div>
            <input type="button" value="下一步" class="btn size5 B ed zeaibg" onClick="regbtnFn();">
            <a href="login.php?<?php echo $urlpar;?>" class="S16 C666">已有帐号？<font class="zeaicolor">立即登录<i class="ico">&#xe601;</i></font></a>
            <input type="hidden" name="tguid" id="tguid" value="<?php echo $tguid;?>">
            <input type="hidden" name="tmpid" id="tmpid" value="<?php echo $tmpid;?>">
            <input type="hidden" name="subscribe" id="subscribe" value="<?php echo $subscribe;?>">
            <input type="hidden" name="submitok" id="submitok" value="ajax_uname_addupdate">
        </form>
    </div>
    <div class="reg_private" id="reg_private">
        <div class="C">
            <h1>《个人隐私与用户协议》提示</h1><em id="reg_privateC"><?php $row = $db->ROW(__TBL_NEWS__,"content","id=1");echo ($row)?dataIO($row[0],'out'):"<div class='nodatatipsS'><i class='ico'>&#xe608;</i>暂时木有内容</div>";;?></em>
            <div class="agreebox"><button class="btn size4 FL zeaiborder zeaicolor" type="button" onClick="zeai.goback();" id="disagree">不同意</button>
            <button class="btn size4 FR zeaibg zeaiborder" type="button" id="agree">同意</button></div>
        </div>
    </div>
	<script>setTimeout(agreeDeclara,500);</script>
<?php }?>
<?php require_once ZEAI.'m/TRnav.php';?>
</body>
</html>
<?php
function flagFn($row){
	global $submitok,$_REG,$_ZEAI,$reg_dataARR,$t,$SHALOU_ARR,$mate_diy;
	$flag=$row['flag'];
	$cook_uid=$row['id'];
	$cook_sex=intval($row['sex']);
	switch ($flag) {
		case -2:header("Location: ".a('{"kind":"my"}'));break;
		case -1:callmsg('当前帐号【UID：'.$row['id'].'】已被注销或锁定','-1');break;
		case 0:callmsg('当前帐号【UID：'.$row['id'].'】状态未审，请等待审核','-1');break;
		case 1:header("Location: ".a('{"kind":"my"}'));break;
		case 2:
			setcookie("cook_uid",$row['id'],time()+31536000,"/",$_ZEAI['CookDomain']);
			setcookie("cook_pwd",$row['pwd'],time()+31536000,"/",$_ZEAI['CookDomain']);
			if (count($reg_dataARR) == 0 && !is_array($reg_dataARR))callmsg('系统注册选项调试中',HOST);
			foreach ($reg_dataARR as $F) {
				$value='';
				if(is_array($SHALOU_ARR) && count($SHALOU_ARR)>0){
					if($F=='mate' && count($mate_diy) >= 1 && is_array($mate_diy)){
						$mate_data='';
						foreach ($mate_diy as $mF){
							$ext = mate_diy_par($mF,'ext');
							if($ext=='radiorange'){
								$m1=$SHALOU_ARR['mate_'.$mF.'1'];
								$m2=$SHALOU_ARR['mate_'.$mF.'2'];
								if(!empty($m1)){$mate_data=$m1;break;}
								if(!empty($m2)){$mate_data=$m2;break;}
							}else{
								$m=$SHALOU_ARR['mate_'.$mF];
								if(!empty($m)){$mate_data=$m;break;}
							}
						}
						$value=$mate_data;
					}else{
						$value=$SHALOU_ARR[$F];
					}
				}
				if(empty($value) || $value=='0000-00-00'){
					header("Location: ".SELF."?t=$F");exit;break;
				}
			}
			set_data_ed_bfb($cook_uid);
			if($cook_sex>0 && $_REG['regmoney'.$cook_sex]>0){
				return 'regpay';
			}
		break;
		case 3:header("Location: ".a('{"kind":"my"}'));break;
	}
	success_flag($cook_uid);
	return 'end';
}
function Dmod($jsonstr){
	global $db,$cook_uid;
	$uid=intval($cook_uid);
	$row = $db->ROW(__TBL_SHALOU__,"uid","uid=".$uid);
	if ($row){
		$db->query("UPDATE ".__TBL_SHALOU__." SET jsonstr='$jsonstr',addtime=".ADDTIME." WHERE uid=".$uid);
	}else{
		$db->query("INSERT INTO ".__TBL_SHALOU__." (uid,jsonstr,addtime) VALUES ($uid,'$jsonstr',".ADDTIME.")");
	}
}
function get_reg_data_bfb($F) {
	global $_REG;
	$fld = $_REG['reg_data'];
	$mate_fld=get_mate_fld();
	//if(!empty($mate_fld))$fld=str_replace('mate',$mate_fld,$fld);
	$ARR=explode(',',$fld);
	$total=count($ARR);
	$n=array_search($F,$ARR);
	$rt=$n/$total;
	$rt=round($rt,2);
	return $rt*100;
}
function data_data_title($F,$data_arr='') {$data_data=(empty($data_arr))?data_data_arr():$data_arr;foreach($data_data as $v){if($v['fieldname'] == $F)return $v['title'];}}
function data_data_subkind($F,$data_arr='') {$data_data=(empty($data_arr))?data_data_arr():$data_arr;foreach($data_data as $v){if($v['fieldname'] == $F)return $v['subkind'];}}
function data_data_arr() {
	global $db;
	$rt = $db->query("SELECT fieldname,title,subkind FROM ".__TBL_UDATA__." WHERE flag=1 ORDER BY px DESC,id DESC");
	while($tmprows = $db->fetch_array($rt,'name')){
		//if (strstr($tmprows['fieldname'],'crm_') || in_array($tmprows['fieldname'],$data_disable) )continue;
		$data_data[]=$tmprows;
	}
	$data_data[]=array('fieldname'=>'mate','title'=>'择偶要求','subkind'=>5);
	return $data_data;
}
function ulclsFn($ARR) {
	$n=count($ARR);
	if($n>=15){
		$ulcls='def limore';
	}elseif($n>=6){
		$ulcls='def li2more';
	}elseif($n>3){
		$ulcls='def mgb15';
	}else{
		$ulcls='def';
	}
	return $ulcls;
}	
ob_end_flush();
?>